Platform Explorer / Nuxeo Platform 6.0

Component studio.extensions.easyshare

Contributions

XML Source

<?xml version="1.0" encoding="UTF-8"?>

<component name="studio.extensions.easyshare" version="1.0.0">
  <require>org.nuxeo.runtime.started</require>
  <extension target="org.nuxeo.ecm.core.schema.TypeService" point="schema">
    <schema name="easysharefolder" prefix="eshare" src="data/schemas/easysharefolder.xsd"/>
  </extension>
  <extension target="org.nuxeo.ecm.core.schema.TypeService" point="doctype">
    <doctype name="EasyShareFolder" extends="Folder">
      <schema name="easysharefolder"/>
      <schema name="uid"/>
    </doctype>
  </extension>
  <extension target="org.nuxeo.ecm.core.lifecycle.LifeCycleService" point="types">
    <types>
      <type name="EasyShareFolder">default</type>
    </types>
  </extension>
  <extension target="org.nuxeo.ecm.platform.types.TypeService" point="types">
    <type id="EasyShareFolder">
      <label>Easy Share Folder</label>
      <category>Collaborative</category>
      <icon>/img/easyshare.png</icon>
      <bigIcon>/img/easyshare_100.png</bigIcon>
      <description>Container for holding shared files and accessible anonymously by URL</description>
      <default-view>view_documents</default-view>
      <subtypes>
        <type>Audio</type>
        <type>File</type>
        <type>Picture</type>
        <type>Video</type>
      </subtypes>
      <layouts mode="create">
        <layout>layout@EasyShareFolder-create</layout>
      </layouts>
      <layouts mode="edit">
        <layout>layout@EasyShareFolder-edit</layout>
      </layouts>
      <layouts mode="view">
        <layout>layout@EasyShareFolder-view</layout>
      </layouts>
      <layouts mode="header">
        <layout>layout@EasyShareFolder-header</layout>
      </layouts>
      <contentViews category="content">
        <contentView showInExportView="false">document_content</contentView>
      </contentViews>
      <contentViews category="trash_content">
        <contentView showInExportView="false">document_trash_content</contentView>
      </contentViews>
    </type>
    <type id="Folder">
      <subtypes>
        <type>EasyShareFolder</type>
      </subtypes>
    </type>
    <type id="Workspace">
      <subtypes>
        <type>EasyShareFolder</type>
      </subtypes>
    </type>
  </extension>
  <extension target="org.nuxeo.ecm.platform.actions.ActionService" point="actions">
    <action id="shareDocsFromWorkflow" label="Share in Easy Share Folder" enabled="true" order="0" type="link" immediate="false" icon="/img/addtoeasyshare.png" link="#{operationActionBean.doOperation('addToAShareDocument')}">
      <category>DEFAULT_LIST</category>
      <filter id="filter@shareDocsFromWorkflow">
        <rule grant="true">
          <permission>ReadWrite</permission>
          <type>EasyShareFolder</type>
        </rule>
      </filter>
    </action>
  </extension>
  <extension target="org.nuxeo.ecm.platform.jbpm.core.JbpmService" point="typeFilter">
    <type name="EasyShareFolder">
      <processDefinition>review_parallel</processDefinition>
      <processDefinition>review_approbation</processDefinition>
    </type>
  </extension>
  <extension target="org.nuxeo.ecm.platform.forms.layout.WebLayoutManager" point="layouts">
    <layout name="layout@EasyShareFolder-create">
      <templates>
        <template mode="any">/layouts/easyshare_layout_template.xhtml</template>
      </templates>
      <rows>
        <row>
          <properties mode="any">
            <property name="nxl_colspan_0">1</property>
          </properties>
          <widget>title</widget>
        </row>
        <row>
          <properties mode="any">
            <property name="nxl_colspan_0">1</property>
          </properties>
          <widget>description</widget>
        </row>
        <row>
          <properties mode="any">
            <property name="nxl_colspan_0">1</property>
          </properties>
          <widget>expired</widget>
        </row>
        <row>
          <properties mode="any">
            <property name="nxl_colspan_0">1</property>
          </properties>
          <widget>shareComment</widget>
        </row>
        <row>
          <properties mode="any">
            <property name="nxl_colspan_0">1</property>
          </properties>
          <widget>contactEmail</widget>
        </row>
      </rows>
      <widget name="title" type="text">
        <labels>
          <label mode="any">Title</label>
        </labels>
        <translated>false</translated>
        <fields>
          <field>dc:title</field>
        </fields>
        <properties widgetMode="edit">
          <property name="styleClass">dataInputText</property>
          <property name="required">true</property>
        </properties>
      </widget>
      <widget name="description" type="textarea">
        <labels>
          <label mode="any">Description</label>
        </labels>
        <translated>false</translated>
        <fields>
          <field>dc:description</field>
        </fields>
        <properties widgetMode="edit">
          <property name="styleClass">dataInputText</property>
        </properties>
      </widget>
      <widget name="expired" type="datetime">
        <labels>
          <label mode="any">Expiration Date</label>
        </labels>
        <helpLabels>
          <label mode="any">Date at which it's no longer publicly available</label>
        </helpLabels>
        <translated>false</translated>
        <fields>
          <field>dc:expired</field>
        </fields>
        <properties widgetMode="edit">
          <property name="required">true</property>
        </properties>
      </widget>
      <widget name="shareComment" type="textarea">
        <labels>
          <label mode="any">Share Comment</label>
        </labels>
        <helpLabels>
          <label mode="any">Message to recipient on share page</label>
        </helpLabels>
        <translated>false</translated>
        <fields>
          <field>eshare:shareComment</field>
        </fields>
      </widget>
      <widget name="contactEmail" type="text">
        <labels>
          <label mode="any">Contact Email</label>
        </labels>
        <helpLabels>
          <label mode="any">Email displayed for provider of share</label>
        </helpLabels>
        <translated>false</translated>
        <fields>
          <field>eshare:contactEmail</field>
        </fields>
      </widget>
    </layout>
    <layout name="layout@EasyShareFolder-edit">
      <templates>
        <template mode="any">/layouts/easyshare_layout_template.xhtml</template>
      </templates>
      <rows>
        <row>
          <properties mode="any">
            <property name="nxl_colspan_0">1</property>
          </properties>
          <widget>title</widget>
        </row>
        <row>
          <properties mode="any">
            <property name="nxl_colspan_0">1</property>
          </properties>
          <widget>description</widget>
        </row>
        <row>
          <properties mode="any">
            <property name="nxl_colspan_0">1</property>
          </properties>
          <widget>shareComment</widget>
        </row>
        <row>
          <properties mode="any">
            <property name="nxl_colspan_0">1</property>
          </properties>
          <widget>expired</widget>
        </row>
        <row>
          <properties mode="any">
            <property name="nxl_colspan_0">1</property>
          </properties>
          <widget>contactEmail</widget>
        </row>
      </rows>
      <widget name="title" type="text">
        <labels>
          <label mode="any">Title</label>
        </labels>
        <translated>false</translated>
        <fields>
          <field>dc:title</field>
        </fields>
        <properties widgetMode="edit">
          <property name="styleClass">dataInputText</property>
          <property name="required">true</property>
        </properties>
      </widget>
      <widget name="description" type="textarea">
        <labels>
          <label mode="any">Description</label>
        </labels>
        <translated>false</translated>
        <fields>
          <field>dc:description</field>
        </fields>
        <properties widgetMode="edit">
          <property name="styleClass">dataInputText</property>
        </properties>
      </widget>
      <widget name="shareComment" type="textarea">
        <labels>
          <label mode="any">ShareComment</label>
        </labels>
        <translated>false</translated>
        <fields>
          <field>eshare:shareComment</field>
        </fields>
        <properties widgetMode="edit">
          <property name="cols">100</property>
          <property name="rows">5</property>
        </properties>
      </widget>
      <widget name="expired" type="datetime">
        <labels>
          <label mode="any">Expiration Date</label>
        </labels>
        <translated>false</translated>
        <fields>
          <field>dc:expired</field>
        </fields>
        <properties widgetMode="edit">
          <property name="required">true</property>
        </properties>
      </widget>
      <widget name="contactEmail" type="text">
        <labels>
          <label mode="any">ContactEmail</label>
        </labels>
        <translated>false</translated>
        <fields>
          <field>eshare:contactEmail</field>
        </fields>
      </widget>
    </layout>
    <layout name="layout@EasyShareFolder-view">
      <templates>
        <template mode="any">/layouts/easyshare_layout_template.xhtml</template>
      </templates>
      <rows>
        <row>
          <properties mode="any">
            <property name="nxl_colspan_0">1</property>
          </properties>
          <widget>title_and_permlink</widget>
        </row>
        <row>
          <properties mode="any">
            <property name="nxl_colspan_0">1</property>
          </properties>
          <widget>description</widget>
        </row>
        <row>
          <properties mode="any">
            <property name="nxl_colspan_0">1</property>
          </properties>
          <widget>expired</widget>
        </row>
        <row>
          <properties mode="any">
            <property name="nxl_colspan_0">1</property>
          </properties>
          <widget>shareComment</widget>
        </row>
        <row>
          <properties mode="any">
            <property name="nxl_colspan_0">1</property>
          </properties>
          <widget>contactEmail</widget>
        </row>
      </rows>
      <widget name="title_and_permlink" type="title_and_permlink">
        <labels>
          <label mode="any">Title and permanent link</label>
        </labels>
        <translated>false</translated>
        <fields>
          <field></field>
          <field>uid:major_version</field>
          <field>uid:minor_version</field>
        </fields>
      </widget>
      <widget name="description" type="textarea">
        <labels>
          <label mode="any">Description</label>
        </labels>
        <translated>false</translated>
        <fields>
          <field>dc:description</field>
        </fields>
      </widget>
      <widget name="expired" type="datetime">
        <labels>
          <label mode="any">Expired</label>
        </labels>
        <translated>false</translated>
        <fields>
          <field>dc:expired</field>
        </fields>
      </widget>
      <widget name="shareComment" type="text">
        <labels>
          <label mode="any">Share Comment</label>
        </labels>
        <translated>false</translated>
        <fields>
          <field>eshare:shareComment</field>
        </fields>
      </widget>
      <widget name="contactEmail" type="text">
        <labels>
          <label mode="any">Contact Email</label>
        </labels>
        <translated>false</translated>
        <fields>
          <field>eshare:contactEmail</field>
        </fields>
      </widget>
    </layout>
    <layout name="layout@EasyShareFolder-header">
      <templates>
        <template mode="any">/layouts/easyshare_layout_template.xhtml</template>
      </templates>
      <properties mode="any">
        <property name="styleClass">easyShareFolderHeader</property>
        <property name="widgetsDisplay">no_label</property>
      </properties>
      <rows>
        <row>
          <properties mode="any">
            <property name="nxl_colspan_0">3</property>
          </properties>
          <widget>title</widget>
        </row>
        <row>
          <properties mode="any">
            <property name="nxl_colspan_0">1</property>
            <property name="nxl_colspan_1">1</property>
            <property name="nxl_colspan_2">1</property>
          </properties>
          <widget>creator</widget>
          <widget>expired</widget>
          <widget>contactEmail</widget>
        </row>
        <row>
          <properties mode="any">
            <property name="nxl_colspan_0">3</property>
          </properties>
          <widget>shareComment</widget>
        </row>
        <row>
          <properties mode="any">
            <property name="nxl_colspan_0">1</property>
            <property name="nxl_colspan_1">1</property>
            <property name="nxl_colspan_2">1</property>
          </properties>
          <widget>documentAction</widget>
          <widget/>
          <widget/>
        </row>
      </rows>
      <widget name="title" type="text">
        <labels>
          <label mode="any">Title</label>
        </labels>
        <translated>false</translated>
        <fields>
          <field>dc:title</field>
        </fields>
        <properties widgetMode="view">
          <property name="styleClass">headerTitle</property>
        </properties>
      </widget>
      <widget name="creator" type="text">
        <labels>
          <label mode="any">Creator</label>
        </labels>
        <translated>false</translated>
        <fields>
          <field>dc:creator</field>
        </fields>
        <properties widgetMode="view">
          <property name="title">Creator</property>
          <property name="styleClass">detail user headerCreator</property>
        </properties>
      </widget>
      <widget name="expired" type="datetime">
        <labels>
          <label mode="any">Share Expiration</label>
        </labels>
        <translated>false</translated>
        <fields>
          <field>dc:expired</field>
        </fields>
        <properties widgetMode="view">
          <property name="title">Expiration Date</property>
          <property name="styleClass">tag label label-light headerExpiration</property>
        </properties>
      </widget>
      <widget name="contactEmail" type="text">
        <labels>
          <label mode="any">Contact Email</label>
        </labels>
        <translated>false</translated>
        <fields>
          <field>eshare:contactEmail</field>
        </fields>
        <properties widgetMode="view">
          <property name="title">Creator's Email</property>
          <property name="styleClass">detail tag headerEmail</property>
        </properties>
      </widget>
      <widget name="shareComment" type="text">
        <labels>
          <label mode="any">Share Comment</label>
        </labels>
        <translated>false</translated>
        <fields>
          <field>eshare:shareComment</field>
        </fields>
        <properties widgetMode="view">
          <property name="styleClass">detail headerComment</property>
        </properties>
      </widget>
      <widget name="documentAction" type="documentAction">
        <labels>
          <label mode="any"></label>
        </labels>
        <translated>false</translated>
        <fields/>
        <properties widgetMode="view">
          <property name="useAjaxForm">false</property>
          <property name="actionId">showEasyShareURL</property>
          <property name="actionsDisplay">buttons</property>
        </properties>
      </widget>
    </layout>
  </extension>
  <extension target="org.nuxeo.ecm.core.versioning.VersioningService" point="versioningRules">
    <versioningRule typeName="EasyShareFolder">
      <initialState major="0" minor="0"/>
      <options lifeCycleState="*">
        <none default="true"/>
        <minor/>
        <major/>
      </options>
    </versioningRule>
  </extension>
  <extension target="org.nuxeo.ecm.platform.ec.notification.service.NotificationService" point="templates">
    <template name="easyShareEmail" src="data/templates/easyShareEmail.ftl"/>
  </extension>
  <extension target="org.nuxeo.ecm.core.operation.OperationServiceComponent" point="chains">
    <chain id="addToAShareDocument">
      <operation id="Seam.GetCurrentDocument"/>
      <operation id="Context.SetInputAsVar">
        <param type="string" name="name">shareDocument</param>
      </operation>
      <operation id="Context.SetVar">
        <param type="string" name="name">shareDocumentPath</param>
        <param type="object" name="value">expr:Document.path</param>
      </operation>
      <operation id="Seam.FetchFromWorklist"/>
      <operation id="CreateProxyLive">
        <param type="string" name="Destination Path">expr:shareDocumentPath</param>
      </operation>
      <operation id="Context.RestoreDocumentInput">
        <param type="string" name="name">shareDocument</param>
      </operation>
      <operation id="Audit.Log">
        <param type="string" name="event">Documents added to the share</param>
        <param type="string" name="category">EasyShareFolderCategory</param>
        <param type="string" name="comment">expr:Some documents were added to the share folder @{Document["dc:title"]}</param>
      </operation>
      <operation id="Seam.Refresh"/>
      <operation id="Seam.AddInfoMessage">
        <param type="string" name="message">Added</param>
      </operation>
    </chain>
    <chain id="navToParent">
      <operation id="Context.FetchDocument"/>
      <operation id="Document.GetParent"/>
      <operation id="Seam.NavigateTo"/>
    </chain>
  </extension>
  <extension target="org.nuxeo.ecm.platform.actions.ActionService" point="filters">
    <filter id="create" append="true">
      <rule grant="true">
        <permission>AddChildren</permission>
        <type>EasyShareFolder</type>
        <condition>!document.isImmutable()</condition>
        <condition>#{typeManager.getAllowedSubTypes(document.getType(), document).size() &gt; 0}</condition>
      </rule>
    </filter>
  </extension>
  <extension target="org.nuxeo.ecm.platform.forms.layout.WebLayoutManager" point="widgettypes">

    
    <documentation>Widget types declared in studio</documentation>

    
    <widgetType name="studio_header">
      
      <configuration>
        
        <title>Header</title>
        
        <description>
          The header widget just displays the widget label.
        </description>
        
        <supportedModes>
          
          <mode>edit</mode>
          
          <mode>view</mode>
        
        </supportedModes>
        
        <fields>
          
          <list>false</list>
          
          <complex>false</complex>
          
          <supportedTypes/>
          
          <defaultTypes/>
        
        </fields>
        
        <handlingLabels>true</handlingLabels>
        
        <categories>
          
          <category>document</category>
          
          <category>studio</category>
        
        </categories>
        
        <properties>
          
          <layouts mode="any">
            
            <layout name="studio_header_widget_type_properties_any">
              
              <rows>
                
                <row>
                  
                  <widget>styleClass</widget>
                
                </row>
                
                <row>
                  
                  <widget>style</widget>
                
                </row>
              
              </rows>
              
              <widget name="styleClass" type="text">
                
                <labels>
                  
                  <label mode="any">Style class</label>
                
                </labels>
                
                <fields>
                  
                  <field>styleClass</field>
                
                </fields>
              
              </widget>
              
              <widget name="style" type="text">
                
                <labels>
                  
                  <label mode="any">Style</label>
                
                </labels>
                
                <fields>
                  
                  <field>style</field>
                
                </fields>
              
              </widget>
            
            </layout>
          
          </layouts>
        
        </properties>
      
      </configuration>
      
      <handler-class>
        org.nuxeo.ecm.platform.forms.layout.facelets.plugins.TemplateWidgetTypeHandler
      </handler-class>
      
      <property name="template">
        /widgets/studio_header_widget.xhtml
      </property>
    
    </widgetType>

    
    <widgetType name="filesList">
      
      <configuration>
        
        <title>Files</title>
        
        <description>
          
          <p>
            The Files displays an editable list of files, using javascript to
            keep the uploaded file path when adding several files in a row.
          </p>
          
          <p>Items are defined using sub wigdets configuration.</p>
          
          <p>
            This is actually a template widget type whose template uses a
            &lt;nxu:inputList /&gt; tag in edit or create mode, and a table
            iterating over items in other modes.
          </p>
        
        </description>
        
        <categories>
          
          <category>document</category>
          
          <category>studio</category>
        
        </categories>
        
        <supportedModes>
          
          <mode>edit</mode>
          
          <mode>view</mode>
        
        </supportedModes>
        
        <acceptingSubWidgets>true</acceptingSubWidgets>
        
        <fields>
          
          <list>true</list>
          
          <complex>false</complex>
          
          <supportedTypes>
            
            <type>blob</type>
          
          </supportedTypes>
          
          <defaultTypes>
            
            <type>blob</type>
          
          </defaultTypes>
        
        </fields>
        
        <properties>
          
          <layouts mode="edit">
            
            <layout name="list_widget_type_properties_edit">
              
              <rows>
                
                <row>
                  
                  <widget>required</widget>
                
                </row>
                
                <row>
                  
                  <widget>diff</widget>
                
                </row>
              
              </rows>
              
              <widget name="required" type="checkbox">
                
                <labels>
                  
                  <label mode="any">Required</label>
                
                </labels>
                
                <fields>
                  
                  <field>required</field>
                
                </fields>
              
              </widget>
              
              <widget name="diff" type="checkbox">
                
                <labels>
                  
                  <label mode="any">Diff</label>
                
                </labels>
                
                <fields>
                  
                  <field>diff</field>
                
                </fields>
              
              </widget>
            
            </layout>
          
          </layouts>
        
        </properties>
      
      </configuration>
      
      <handler-class>
        org.nuxeo.ecm.platform.forms.layout.facelets.plugins.TemplateWidgetTypeHandler
      </handler-class>
      
      <property name="template">/widgets/files_list_widget_template.xhtml
      </property>
    
    </widgetType>

  
  </extension>
</component>